import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as EleIcons from '@element-plus/icons-vue'
// import '@/plugins/element'

//导入mock配置
require('../mock/mock-user')
// 导入路由鉴权
import '@/permission'
// 导入i18n
import i18n from '@/i18n'

//初始化样式
import '@/styles/index.scss'
//导入svgIcon
import installIcons from '@/icons'
import en from "element-plus/lib/locale/lang/en";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import ElementPlus from "element-plus";

const app = createApp(App)
installIcons(app) // 默认去配置就行了，别纠结
app.use(router)
app.use(store)
app.use(i18n)

// TODO element-plus 多语言切换问题
// app.use({},{
//     // locale: store.getters.language === 'en' ? en : zhCn
//     locale: zhCn
// })

// 引入 elment-plus 的所有icon
for (const name in EleIcons) {
    app.component(name, EleIcons[name])
}

app.mount('#app')
